package com.gycode.vpush.config.mq;

import com.aliyun.openservices.ons.api.PropertyKeyConst;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Properties;

@Component
public class RocketMqConfig {
    @Value("${rocketmq.accessKey}")
    private String accessKey;
    @Value("${rocketmq.secretKey}")
    private String secretKey;
    @Value("${rocketmq.nameSrvAddr}")
    private String nameSrvAddr;
    @Value("${rocketmq.topic}")
    private String topic;
    @Value("${rocketmq.groupId}")
    private String groupId;
    @Value("${rocketmq.topicBroadcast}")
    private String topicBroadcast;
    @Value("${rocketmq.groupIdBroadcast}")
    private String groupIdBroadcast;

    public Properties getMqPropertie() {
        Properties properties = new Properties();
        properties.setProperty(PropertyKeyConst.AccessKey, this.accessKey);
        properties.setProperty(PropertyKeyConst.SecretKey, this.secretKey);
        properties.setProperty(PropertyKeyConst.NAMESRV_ADDR, this.nameSrvAddr);
        return properties;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getNameSrvAddr() {
        return nameSrvAddr;
    }

    public void setNameSrvAddr(String nameSrvAddr) {
        this.nameSrvAddr = nameSrvAddr;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getTopicBroadcast() {
        return topicBroadcast;
    }

    public void setTopicBroadcast(String topicBroadcast) {
        this.topicBroadcast = topicBroadcast;
    }

    public String getGroupIdBroadcast() {
        return groupIdBroadcast;
    }

    public void setGroupIdBroadcast(String groupIdBroadcast) {
        this.groupIdBroadcast = groupIdBroadcast;
    }
}
